# 通过`filter`语句来筛选出`Grade`为`A`的同学
from pprint import pprint
classes1= [
    {"name": "n_1", "age": 11, "grade": "A"},
    {"name": "n_88", "age": 22, "grade": "B"},
    {"name": "n_3", "age": 99, "grade": "A"},
    {"name": "n_6", "age": 44, "grade": "A"},
    {"name": "n_5", "age": 33, "grade": "C"},
    {"name": "n_77", "age": 66, "grade": "D"},
    {"name": "n_7", "age": 77, "grade": "A"},
]
pprint(classes1)

f=filter(lambda x:x.get('grade')=='A',classes1)
print("grade为A的同学有：")
pprint(list(f))


